//
// Created by subject on 2025/2/19.
//

#ifndef DEEPSEEK_LLMMANAGER_H
#define DEEPSEEK_LLMMANAGER_H

#include <memory> // 用于 std::unique_ptr
#include <string>
#include <vector>
#include "rkllm.h"
#include "LogUtils.h"

class LlmManager{

public:
    // 获取单例实例的静态方法
    static LlmManager& getInstance();
    // 删除拷贝构造函数和赋值运算符，防止复制
    LlmManager(const LlmManager&) = delete;
    LlmManager& operator=(const LlmManager&) = delete;

    // 初始化LLM
    bool initialize(const std::string& modelPath, int maxNewTokens, int maxContextLen, LLMResultCallback callback);
    void run(const std::string& input);
    void destroy();
    bool isInitialized();


private:
// 私有构造函数，防止外部实例化
    LlmManager();
// 私有析构函数
    ~LlmManager();

// 私有成员变量
    LLMHandle llmHandle;
    bool initialized;
    RKLLMInferParam inferParams;

};

#endif //DEEPSEEK_LLMMANAGER_H
